testsuite: Add rtl icontheme tests
authorBenjamin Otte <otte@redhat.com>
Wed, 14 May 2014 02:52:55 +0000 (04:52 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 14 May 2014 02:55:11 +0000 (04:55 +0200)
testsuite/gtk/Makefile.am
testsuite/gtk/icons/scalable/everything-justrtl-rtl.svg [new file with mode: 0644]
testsuite/gtk/icons/scalable/everything-rtl.svg [new file with mode: 0644]
testsuite/gtk/icons/scalable/everything-symbolic-rtl.svg [new file with mode: 0644]
testsuite/gtk/icontheme.c

index 927241ca3b32b0510e624cd95286afa1f944d867..615c9fc1aef0d1de46e0cf8563239e6301ba239f 100644 (file)
@@ -129,6 +129,9 @@ test_icontheme =                                    \
        icons/16x16/simple.png                          \
        icons/index.theme                               \
        icons/scalable/everything-justregular.svg       \
+       icons/scalable/everything-justrtl-rtl.svg       \
+       icons/scalable/everything-rtl.svg               \
+       icons/scalable/everything-symbolic-rtl.svg      \
        icons/scalable/everything-justsymbolic-symbolic.svg     \
        icons/scalable/everything.svg                   \
        icons/scalable/everything-symbolic.svg          \
diff --git a/testsuite/gtk/icons/scalable/everything-justrtl-rtl.svg b/testsuite/gtk/icons/scalable/everything-justrtl-rtl.svg
new file mode 100644 (file)
index 0000000..3353c25
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="128" height="128" version="1.1" xmlns="http://www.w3.org/2000/svg">
+  <rect x="32" y="0" width="32" height="32" fill="black"/>
+  <rect x="0" y="32" width="32" height="32" fill="black"/>
+  <rect x="96" y="0" width="32" height="32" fill="black"/>
+  <rect x="64" y="32" width="32" height="32" fill="black"/>
+  <rect x="32" y="64" width="32" height="32" fill="black"/>
+  <rect x="0" y="96" width="32" height="32" fill="black"/>
+  <rect x="96" y="64" width="32" height="32" fill="black"/>
+  <rect x="64" y="96" width="32" height="32" fill="black"/>
+</svg>
diff --git a/testsuite/gtk/icons/scalable/everything-rtl.svg b/testsuite/gtk/icons/scalable/everything-rtl.svg
new file mode 100644 (file)
index 0000000..d63acbc
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="128" height="128" version="1.1" xmlns="http://www.w3.org/2000/svg">
+  <rect x="64" y="0" width="64" height="64" fill="black"/>
+  <rect x="0" y="64" width="64" height="64" fill="black"/>
+</svg>
diff --git a/testsuite/gtk/icons/scalable/everything-symbolic-rtl.svg b/testsuite/gtk/icons/scalable/everything-symbolic-rtl.svg
new file mode 100644 (file)
index 0000000..d63acbc
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="128" height="128" version="1.1" xmlns="http://www.w3.org/2000/svg">
+  <rect x="64" y="0" width="64" height="64" fill="black"/>
+  <rect x="0" y="64" width="64" height="64" fill="black"/>
+</svg>
index 4e1a7d8126c8aafd274a13b991937409af393de9..d4f4783f0ad0c5c84b340151e7ae81fbf90fbad7 100644 (file)
@@ -368,6 +368,43 @@ test_force_regular (void)
                       "/icons/scalable/everything.svg");
 }
 
+static void
+test_rtl (void)
+{
+  assert_icon_lookup ("everything",
+                      SCALABLE_IMAGE_SIZE,
+                      GTK_ICON_LOOKUP_DIR_RTL,
+                      "/icons/scalable/everything-rtl.svg");
+  assert_icon_lookup ("everything-symbolic",
+                      SCALABLE_IMAGE_SIZE,
+                      GTK_ICON_LOOKUP_DIR_RTL,
+                      "/icons/scalable/everything-symbolic-rtl.svg");
+
+  assert_icon_lookup_fails ("everything-justrtl",
+                            SCALABLE_IMAGE_SIZE,
+                            0);
+  assert_icon_lookup_fails ("everything-justrtl",
+                            SCALABLE_IMAGE_SIZE,
+                            GTK_ICON_LOOKUP_DIR_LTR);
+  assert_icon_lookup ("everything-justrtl",
+                      SCALABLE_IMAGE_SIZE,
+                      GTK_ICON_LOOKUP_DIR_RTL,
+                      "/icons/scalable/everything-justrtl-rtl.svg");
+
+  assert_icon_lookup ("everything-justrtl",
+                      SCALABLE_IMAGE_SIZE,
+                      GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+                      "/icons/scalable/everything.svg");
+  assert_icon_lookup ("everything-justrtl",
+                      SCALABLE_IMAGE_SIZE,
+                      GTK_ICON_LOOKUP_GENERIC_FALLBACK | GTK_ICON_LOOKUP_DIR_LTR,
+                      "/icons/scalable/everything.svg");
+  assert_icon_lookup ("everything-justrtl",
+                      SCALABLE_IMAGE_SIZE,
+                      GTK_ICON_LOOKUP_GENERIC_FALLBACK | GTK_ICON_LOOKUP_DIR_RTL,
+                      "/icons/scalable/everything-justrtl-rtl.svg");
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -378,6 +415,7 @@ main (int argc, char *argv[])
   g_test_add_func ("/icontheme/generic-fallback", test_generic_fallback);
   g_test_add_func ("/icontheme/force-symbolic", test_force_symbolic);
   g_test_add_func ("/icontheme/force-regular", test_force_regular);
+  g_test_add_func ("/icontheme/rtl", test_rtl);
 
   return g_test_run();
 }